import React from 'react';
import {Layout, Menu, Drawer, message} from 'antd';
import {NavLink} from 'react-router-dom';
import {
    MenuUnfoldOutlined,
    MenuFoldOutlined,
    MacCommandFilled,

    UserOutlined,
    CustomerServiceFilled,
    SettingOutlined,
    BellOutlined,

    FileTextFilled,
    ShoppingFilled,
    SecurityScanFilled,
    PayCircleFilled,
    SlackCircleFilled,
    ProjectFilled,

    CreditCardFilled,
    ShopFilled,
    ExportOutlined,
    GiftFilled,
    EditFilled,
    MessageFilled,
    InfoCircleFilled,
    FileWordFilled,
    SettingFilled,
    ContainerFilled,
    CompassFilled
} from '@ant-design/icons';
import logo from '../../images/hp_logo.png'
import './HomePage.css'
import {getSessionStoreage} from "../../util/storeage";
import {observer,inject} from 'mobx-react';
import NewBreadcrumb from "../NewBreadcrumb";
import OpinionRate from "../../pages/OpinionRate/OpinionRate";
import ServiceBox from "../../pages/ServiceBox/ServiceBox";
import NoticeMessage from '../../comm/Message/Message'
const { Header, Sider, Content } = Layout;
const { SubMenu } = Menu;
const iconstyle={
    color:'white',
    fontSize:'20px'
}
@inject('loginStore','breadcrumbStore')
@observer
class App extends React.Component {
    constructor(){
        super()
        this.state={
            collapsed: false,
            visible1:false,
            visible2:false,
            placement1:'right',
            placement2:'right',
            top:'44px',
            serviceBoxState:false,   //客服窗口的显示状态
            canMove:false,    //是否可以移动
        }
    }
    toggle = () => {
        this.setState({
            collapsed: !this.state.collapsed,
        });
    };
    loginOut=()=>{
        this.props.loginStore.loginOut().then(res=>{
            message.loading('正在加载...', 0.5)
                .then(() => message.success('退出登录', 1))
            this.props.history.push('/login')
        })
    };
    showDrawer1 = () => {
        this.setState({
            visible1: true,
            top:'44px'
        });
    };
    showDrawer2 = () => {
        console.log(123)
        this.setState({
            visible2: true,
        });
    };
    onClose1 = () => {
        this.setState({
            visible1: false,
            top:'0px'
        });
    };
    onClose2 = () => {
        this.setState({
            visible2: false,
        });
    };
    onChange1 = e => {
        this.setState({
            placement1: e.target.value,
        });
    };
    onChange2 = e => {
        this.setState({
            placement2: e.target.value,
        });
    };
    changebreadcrum=(path,name)=>{
        this.props.breadcrumbStore.changebreadcrumb(path,name)
    };
    //改变state的值
    changeState=(name,value)=>{
        this.setState({
            [name]:value
        })
    };
    //点击按钮显示客服弹窗
    showServiceBox=()=>{
        this.changeState('serviceBoxState',true);
    };
    //关闭客服弹窗
    closeServiceBox=()=>{
        this.changeState('serviceBoxState',false);
    };
    //是否显示客服组件
    showWindow=()=>{
        if(this.state.serviceBoxState){
            return <ServiceBox canMove={this.state.canMove} changeMoveState={this.changeMoveState} closeServiceBox={this.closeServiceBox}/>
        }
    };
    //改变移动状态
    changeMoveState=(newState)=>{
        this.changeState('canMove',newState);
    };
    //生命周期函数
    componentDidMount() {
        // let name=sessionStorage.getItem('routername')
        // if(name==='首页'||name===null){
        //     console.log(123)
        //     sessionStorage.setItem('routerpath',undefined)
        //     sessionStorage.setItem('routername',undefined)
        // }
    }
    render() {
        const showWindow=this.showWindow();
        return (
            <Layout>
                <Header className="site-layout-background headerstyle" style={{ padding: 0,backgroundColor:'#03B8CC',height:'44px',lineHeight:'44px'}}>
                    <div>
                        <img src={logo} style={{height:'34px'}} alt=""/>
                        {React.createElement(this.state.collapsed ? MenuUnfoldOutlined : MenuFoldOutlined, {
                            className: 'trigger',
                            onClick: this.toggle,
                            style:{color:"white"}
                        })}
                    </div>
                    <div className='headeright'>
                        <Menu onClick={this.handleClick} selectedKeys={[this.state.current]} mode="horizontal" style={{backgroundColor:'#03B8CC'}}>
                            <SubMenu
                                title={
                                    <>
                                        <span style={{color:'white'}}>{getSessionStoreage('username')}</span>
                                        &nbsp;&nbsp;
                                        <UserOutlined style={iconstyle}/>
                                    </>
                                }
                            >
                                <Menu.Item key="zhanghuxinxi">
                                    <NavLink to='/homepage/userinfo' onClick={this.changebreadcrum.bind(this,'/homepage/userinfo','账号信息')}>
                                        <CreditCardFilled/>
                                        账号信息
                                    </NavLink>
                                </Menu.Item>
                                {/*<Menu.Item key="goumai">*/}
                                {/*    <ShopFilled/>*/}
                                {/*    服务购买*/}
                                {/*</Menu.Item>*/}
                                <Menu.Item key="back" onClick={this.loginOut}>
                                    <ExportOutlined/>
                                    退出
                                </Menu.Item>
                            </SubMenu>
                            <SubMenu
                                title={
                                    <>
                                        <CustomerServiceFilled style={iconstyle}/>
                                    </>
                                }
                            >
                                {/*<Menu.Item key="xuyuan">*/}
                                {/*    <GiftFilled/>*/}
                                {/*    新功能许愿*/}
                                {/*</Menu.Item>*/}
                                <Menu.Item key="yijian" onClick={this.showDrawer1}>
                                    <EditFilled/>
                                    意见反馈
                                </Menu.Item>
                                <Menu.Item key="kefu" onClick={this.showServiceBox}>
                                    <MessageFilled/>
                                    在线客服
                                </Menu.Item>
                            </SubMenu>
                            <SubMenu mode="horizontal"
                                title={
                                    <>
                                        <SettingOutlined style={iconstyle}/>
                                    </>
                                }
                            >
                                <SubMenu
                                    key="jichuziliao"
                                    title={
                                        <span>
                                            <InfoCircleFilled />
                                            <span>基础资料</span>
                                        </span>
                                    }
                                >
                                    <Menu.Item key="compinfo">
                                        <NavLink to='/homepage/companyinfo' onClick={this.changebreadcrum.bind(this,'/homepage/companyinfo','公司信息')}>
                                            公司信息
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="groupstaff">
                                        <NavLink to='/homepage/departmentandstaff' onClick={this.changebreadcrum.bind(this,'/homepage/departmentandstaff','部门与员工')}>
                                            部门与员工
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>


                                <SubMenu
                                    key="fuzuziliao"
                                    title={
                                        <span>
                                            <FileWordFilled />
                                            <span>辅助资料</span>
                                        </span>
                                    }
                                >
                                        <Menu.Item key="shangpinfenlei">
                                            <NavLink to='/homepage/goodsclassify' onClick={this.changebreadcrum.bind(this,'/homepage/goodsclassify','商品分类')}>
                                                商品分类
                                            </NavLink>
                                        </Menu.Item>
                                        <Menu.Item key="shangpinpinpai">
                                            <NavLink to='/homepage/goodsbrand' onClick={this.changebreadcrum.bind(this,'/homepage/goodsbrand','商品品牌')}>
                                                商品品牌
                                            </NavLink>
                                        </Menu.Item>
                                        <Menu.Item key="danwei">
                                            <NavLink to='/homepage/units' onClick={this.changebreadcrum.bind(this,'/homepage/units','计量单位')}>
                                                计量单位
                                            </NavLink>
                                        </Menu.Item>
                                        <Menu.Item key="guize">
                                            <NavLink to='/homepage/dealerlevel' onClick={this.changebreadcrum.bind(this,'/homepage/dealerlevel','经销商级别')}>
                                                经销商级别
                                            </NavLink>
                                        </Menu.Item>
                                        <Menu.Item key="ordertype">
                                            <NavLink to='/homepage/accounttype' onClick={this.changebreadcrum.bind(this,'/homepage/accounttype','账期类型')}>
                                                账期类型
                                            </NavLink>
                                        </Menu.Item>
                                        <Menu.Item key="xuyu">
                                            <NavLink to='/homepage/dealerarea' onClick={this.changebreadcrum.bind(this,'/homepage/dealerarea','经销商归属区域')}>
                                                经销商归属区域
                                            </NavLink>
                                        </Menu.Item>
                                        <Menu.Item key="fenlei">
                                            <NavLink to='/homepage/noticeclassify' onClick={this.changebreadcrum.bind(this,'/homepage/noticeclassify','通知分类')}>
                                                通知分类
                                            </NavLink>
                                        </Menu.Item>
                                        <Menu.Item key="cangku">
                                            <NavLink to='/homepage/storehouse' onClick={this.changebreadcrum.bind(this,'/homepage/storehouse','仓库')}>
                                                仓库
                                            </NavLink>
                                        </Menu.Item>
                                </SubMenu>

                                <SubMenu
                                    key="xitongsetting"
                                    title={
                                        <span>
                                            <SettingFilled />
                                            <span>系统设置</span>
                                        </span>
                                    }
                                >
                                        {/*<Menu.Item key="settingcanshu">系统参数设置</Menu.Item>*/}
                                        <Menu.Item key="orderliucheng">
                                            <NavLink to='/homepage/orderprocess' onClick={this.changebreadcrum.bind(this,'/homepage/orderprocess','订单处理流程设置')}>
                                                订单处理流程设置
                                            </NavLink>
                                        </Menu.Item>
                                </SubMenu>
                                {/*<Menu.Item key="caozuo">*/}
                                {/*    <ContainerFilled/>*/}
                                {/*    操作日志*/}
                                {/*</Menu.Item>*/}
                                {/*<Menu.Item key="tansuo">*/}
                                {/*    <CompassFilled/>*/}
                                {/*    探索易订货*/}
                                {/*</Menu.Item>*/}
                            </SubMenu>
                            <Menu.Item key="xitonggonggao" onClick={this.showDrawer2}>
                                <BellOutlined style={iconstyle}/>
                            </Menu.Item>
                        </Menu>
                    </div>
                </Header>
                <Layout className="site-layout">
                    <Sider style={{backgroundColor:'white'}} trigger={null} collapsible collapsed={this.state.collapsed} width={120} minwidth={120} maxwidth={120}>
                        <Menu theme="light"  defaultSelectedKeys={['1']} style={{textAlign:'center'}}>
                            <SubMenu key='homepage' title={
                                <span>
                                    <MacCommandFilled />
                                    <span>首页</span>
                                </span>
                            }  className='menustyle'>
                                <Menu.Item key="/homepage/indexpage">
                                    <NavLink to='/homepage/indexpage' onClick={this.changebreadcrum.bind(this,'/homepage/indexpage','首页')}>
                                        首页
                                    </NavLink>
                                </Menu.Item>
                            </SubMenu>

                            <SubMenu key="sub1" title={
                                <span>
                                    <FileTextFilled />
                                    <span>订单</span>
                                </span>
                            } className='menustyle' >
                                <SubMenu key="sub1_1" title="订单管理">
                                    <Menu.Item key="order">
                                        <NavLink to='/homepage/purchaseorder' onClick={this.changebreadcrum.bind(this,'/homepage/purchaseorder','订货单')}>
                                            订货单
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="tuihuo">
                                        <NavLink to='/homepage/returnorder' onClick={this.changebreadcrum.bind(this,'/homepage/returnorder','退货单')}>
                                            退货单
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                                <SubMenu key="sub1_2" title="订单统计">
                                    <Menu.Item key="121">
                                        <NavLink to='/homepage/outOfstockrecord' onClick={this.changebreadcrum.bind(this,'/homepage/outOfstockrecord','出库/发货记录')}>
                                            出库/发货记录
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="122">
                                        <NavLink to='/homepage/ordergoodsbydetailed' onClick={this.changebreadcrum.bind(this,'/homepage/ordergoodsbydetailed','订单商品统计(明细)')}>
                                            订单商品统计(明细)
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="123">
                                        <NavLink to='/homepage/ordergoodsbycustomer' onClick={this.changebreadcrum.bind(this,'/homepage/ordergoodsbycustomer','订单商品统计(按客户)')}>
                                            订单商品统计(按客户)
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="124">
                                        <NavLink to='/homepage/ordergoodsbygoods' onClick={this.changebreadcrum.bind(this,'/homepage/ordergoodsbygoods','订单商品统计(按商品)')}>
                                            订单商品统计(按商品)
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="125">
                                        <NavLink to='/homepage/shipmentstatistics' onClick={this.changebreadcrum.bind(this,'/homepage/shipmentstatistics','发货统计')}>
                                            发货统计
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                                <SubMenu key="sub1_3" title="退单统计">
                                    <Menu.Item key="131">
                                        <NavLink to='/homepage/chargebackgoodsstatistics' onClick={this.changebreadcrum.bind(this,'/homepage/chargebackgoodsstatistics','退单商品统计')}>
                                            退单商品统计
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                                <SubMenu key="sub1_4" title="配送管理">
                                    <Menu.Item key="141">
                                        <NavLink to='/homepage/vehiclemanage' onClick={this.changebreadcrum.bind(this,'/homepage/vehiclemanage','车辆管理')}>
                                            车辆管理
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="142">
                                        <NavLink to='/homepage/distributiontask' onClick={this.changebreadcrum.bind(this,'/homepage/distributiontask','配送任务')}>
                                            配送任务
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                            </SubMenu>

                            <SubMenu key="sub2" title={
                                <span>
                                    <ShoppingFilled />
                                    <span>商品</span>
                                </span>
                            } className='menustyle' >
                                <SubMenu key="sub2_1" title="商品管理">
                                    <Menu.Item key="211">
                                        <NavLink to='/homepage/productslist' onClick={this.changebreadcrum.bind(this,'/homepage/productslist','商品列表')}>
                                            商品列表
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                                <SubMenu key="sub2_2" title="库存管理">
                                    <Menu.Item key="221">
                                        <NavLink to='/homepage/productsinventory' onClick={this.changebreadcrum.bind(this,'/homepage/productsinventoryt','商品库存')}>
                                            商品库存
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="222">
                                        <NavLink to='/homepage/productsin' onClick={this.changebreadcrum.bind(this,'/homepage/productsin','商品入库')}>
                                            商品入库
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="223">
                                        <NavLink to='/homepage/productsout' onClick={this.changebreadcrum.bind(this,'/homepage/productsout','商品出库')}>
                                            商品出库
                                        </NavLink>
                                    </Menu.Item>
                                    {/*<Menu.Item key="224">*/}
                                    {/*    <NavLink to='/homepage/inventorycommit' onClick={this.changebreadcrum.bind(this,'/homepage/inventorycommit','库存调拨')}>*/}
                                    {/*        库存调拨*/}
                                    {/*    </NavLink>*/}
                                    {/*</Menu.Item>*/}
                                    {/*<Menu.Item key="225">*/}
                                    {/*    <NavLink to='/homepage/productscheck' onClick={this.changebreadcrum.bind(this,'/homepage/productscheck','库存盘点')}>*/}
                                    {/*        库存盘点*/}
                                    {/*    </NavLink>*/}
                                    {/*</Menu.Item>*/}
                                    {/*<Menu.Item key="226">*/}
                                    {/*    <NavLink to='/homepage/inoutdetails' onClick={this.changebreadcrum.bind(this,'/homepage/inoutdetails','出入库明细')}>*/}
                                    {/*        出入库明细*/}
                                    {/*    </NavLink>*/}
                                    {/*</Menu.Item>*/}
                                    {/*<Menu.Item key="227">*/}
                                    {/*    <NavLink to='/homepage/productssummary' onClick={this.changebreadcrum.bind(this,'/homepage/productssummary','商品收发汇总')}>*/}
                                    {/*        商品收发汇总*/}
                                    {/*    </NavLink>*/}
                                    {/*</Menu.Item>*/}
                                    {/*<Menu.Item key="228">*/}
                                    {/*    <NavLink to='/homepage/costadjust' onClick={this.changebreadcrum.bind(this,'/homepage/costadjust','成本调整')}>*/}
                                    {/*        成本调整*/}
                                    {/*    </NavLink>*/}
                                    {/*</Menu.Item>*/}
                                    {/*<Menu.Item key="229">*/}
                                    {/*    <NavLink to='/homepage/qimojiezhuan' onClick={this.changebreadcrum.bind(this,'/homepage/qimojiezhuan','期末结转')}>*/}
                                    {/*        期末结转*/}
                                    {/*    </NavLink>*/}
                                    {/*</Menu.Item>*/}
                                </SubMenu>
                                <SubMenu key="sub2_3" title="采购管理">
                                    {/*<Menu.Item key="231">*/}
                                    {/*    <NavLink to='/homepage/rrovidermanager' onClick={this.changebreadcrum.bind(this,'/homepage/rrovidermanager','供应商管理')}>*/}
                                    {/*        供应商管理*/}
                                    {/*    </NavLink>*/}
                                    {/*</Menu.Item>*/}
                                    {/*<Menu.Item key="232">*/}
                                    {/*    <NavLink to='/homepage/smartsourcing' onClick={this.changebreadcrum.bind(this,'/homepage/smartsourcing','智能采购')}>*/}
                                    {/*        智能采购*/}
                                    {/*    </NavLink>*/}
                                    {/*</Menu.Item>*/}
                                    <Menu.Item key="233">
                                        <NavLink to='/homepage/purchaseorders' onClick={this.changebreadcrum.bind(this,'/homepage/purchaseorders','采购订单')}>
                                            采购订单
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="234">
                                        <NavLink to='/homepage/purchasereturn' onClick={this.changebreadcrum.bind(this,'/homepage/purchasereturn','采购退货')}>
                                            采购退货
                                        </NavLink>
                                    </Menu.Item>
                                    {/*<Menu.Item key="235">*/}
                                    {/*    <NavLink to='/homepage/purchasesummary' onClick={this.changebreadcrum.bind(this,'/homepage/purchasesummary','采购汇总')}>*/}
                                    {/*        采购汇总*/}
                                    {/*    </NavLink>*/}
                                    {/*</Menu.Item>*/}
                                </SubMenu>
                            </SubMenu>

                            <SubMenu key="sub3" title={
                                <span>
                                    <SecurityScanFilled />
                                    <span>客户</span>
                                </span>
                            } className='menustyle menustyle1' >
                                <Menu.Item key="sub3_1">
                                    <NavLink to='/homepage/client' onClick={this.changebreadcrum.bind(this,'/homepage/client','客户列表')}>
                                        客户列表
                                    </NavLink>
                                </Menu.Item>
                                <Menu.Item key="sub3_2">
                                    <NavLink to='/homepage/business' onClick={this.changebreadcrum.bind(this,'/homepage/business','商机管理')}>
                                        商机管理
                                    </NavLink>
                                </Menu.Item>
                                <Menu.Item key="sub3_3">
                                    <NavLink to='/homepage/feedback' onClick={this.changebreadcrum.bind(this,'/homepage/feedback','客户反馈')}>
                                        客户反馈
                                    </NavLink>
                                </Menu.Item>
                            </SubMenu>

                            <SubMenu key="sub4" title={
                                <span>
                                    <PayCircleFilled />
                                    <span>资金</span>
                                </span>
                            } className='menustyle' >
                                <SubMenu key="sub4_1" title="资金管理">
                                    <Menu.Item key="411">
                                        <NavLink to='/homepage/voucher' onClick={this.changebreadcrum.bind(this,'/homepage/voucher','收货单')}>
                                            收货单
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="412">
                                        <NavLink to='/homepage/paymentorder' onClick={this.changebreadcrum.bind(this,'/homepage/paymentorder','付款单')}>
                                            付款单
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="413">
                                        <NavLink to='/homepage/paymentsure' onClick={this.changebreadcrum.bind(this,'/homepage/paymentsure','收款确认')}>
                                            收款确认
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="414">
                                        <NavLink to='/homepage/refundsure' onClick={this.changebreadcrum.bind(this,'/homepage/refundsure','退款确认')}>
                                            退款确认
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="415">
                                        <NavLink to='/homepage/capitalaccount' onClick={this.changebreadcrum.bind(this,'/homepage/capitalaccount','资金账户')}>
                                            资金账户
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="416">
                                        <NavLink to='/homepage/paymentaccount' onClick={this.changebreadcrum.bind(this,'/homepage/paymentaccount','收款账户')}>
                                            收款账户
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="417">
                                        <NavLink to='/homepage/otherpayments' onClick={this.changebreadcrum.bind(this,'/homepage/otherpayments','其他收支')}>
                                            其他收支
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                                <SubMenu key="sub4_2" title="对账管理">
                                    <Menu.Item key="421">
                                        <NavLink to='/homepage/clientreconciliation' onClick={this.changebreadcrum.bind(this,'/homepage/clientreconciliation','客户对账')}>
                                            客户对账
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="422">
                                        <NavLink to='/homepage/customerstatement' onClick={this.changebreadcrum.bind(this,'/homepage/customerstatement','客户对账单')}>
                                            客户对账单
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="423">
                                        <NavLink to='/homepage/record' onClick={this.changebreadcrum.bind(this,'/homepage/record','核销记录')}>
                                            核销记录
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                                <SubMenu key="sub4_3" title="资金统计">
                                    <Menu.Item key="431">
                                        <NavLink to='/homepage/paymentdetails' onClick={this.changebreadcrum.bind(this,'/homepage/paymentdetails','收支明细')}>
                                            收支明细
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="432">
                                        <NavLink to='/homepage/ordercollection' onClick={this.changebreadcrum.bind(this,'/homepage/ordercollection','订单收款统计')}>
                                            订单收款统计
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                            </SubMenu>

                            <SubMenu key="sub5" title={
                                <span>
                                    <SlackCircleFilled />
                                    <span>营销</span>
                                </span>
                            } className='menustyle' >
                                <SubMenu key="sub5_1" title="通知发布">
                                    <Menu.Item key="511">
                                        <NavLink to='/homepage/advertisingrelease' onClick={this.changebreadcrum.bind(this,'/homepage/advertisingrelease','广告发布')}>
                                            广告发布
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="512">
                                        <NavLink to='/homepage/notificationannouncement' onClick={this.changebreadcrum.bind(this,'/homepage/notificationannouncement','通知公告')}>
                                            通知公告
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="513">
                                        <NavLink to='/homepage/noterecharge' onClick={this.changebreadcrum.bind(this,'/homepage/noterecharge','短信充值')}>
                                            短信充值
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="514">
                                        <NavLink to='/homepage/notificationsetting' onClick={this.changebreadcrum.bind(this,'/homepage/notificationsetting','通知设置')}>
                                            通知设置
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                                <SubMenu key="sub5_2" title="促销管理">
                                    <Menu.Item key="521">
                                        <NavLink to='/homepage/productpromotion' onClick={this.changebreadcrum.bind(this,'/homepage/productpromotion','商品促销')}>
                                            商品促销
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="522">
                                        <NavLink to='/homepage/orderspromotion' onClick={this.changebreadcrum.bind(this,'/homepage/orderspromotion','订单促销')}>
                                            订单促销
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="523">
                                        <NavLink to='/homepage/combinationpromotion' onClick={this.changebreadcrum.bind(this,'/homepage/combinationpromotion','组合促销')}>
                                            组合促销
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                                <SubMenu key="sub5_3" title="营销工具">
                                    <Menu.Item key="531">
                                        <NavLink to='/homepage/slyderadventure' onClick={this.changebreadcrum.bind(this,'/homepage/slyderadventure','大转盘')}>
                                            大转盘
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="532">
                                        <NavLink to='/homepage/discountcoupon' onClick={this.changebreadcrum.bind(this,'/homepage/discountcoupon','优惠券')}>
                                            优惠券
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="533">
                                        <NavLink to='/homepage/effectanalysis' onClick={this.changebreadcrum.bind(this,'/homepage/effectanalysis','效果分析')}>
                                            效果分析
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="534">
                                        <NavLink to='/homepage/integral' onClick={this.changebreadcrum.bind(this,'/homepage/integral','积分')}>
                                            积分
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="535">
                                        <NavLink to='/homepage/pullnewcommission' onClick={this.changebreadcrum.bind(this,'/homepage/pullnewcommission','拉新提成')}>
                                            拉新提成
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                            </SubMenu>

                            <SubMenu key="sub6" title={
                                <span>
                                    <ProjectFilled />
                                    <span>报表</span>
                                </span>
                            } className='menustyle' >
                                <SubMenu key="sub6_1" title="订货相关">
                                    <Menu.Item key="611">
                                        <NavLink to='/homepage/reorder' onClick={this.changebreadcrum.bind(this,'/homepage/reorder','订单统计报表')}>
                                            订单统计报表
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="612">
                                        <NavLink to='/homepage/rearea' onClick={this.changebreadcrum.bind(this,'/homepage/rearea','地区统计报表')}>
                                            地区统计报表
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="613">
                                        <NavLink to='/homepage/resale' onClick={this.changebreadcrum.bind(this,'/homepage/resale','商品销售报表')}>
                                            商品销售报表
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="614">
                                        <NavLink to='/homepage/recustomerorder' onClick={this.changebreadcrum.bind(this,'/homepage/recustomerorder','客户订货报表')}>
                                            客户订货报表
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                                <SubMenu key="sub6_2" title="利润损耗">
                                    <Menu.Item key="621">
                                        <NavLink to='/homepage/regrossmargin' onClick={this.changebreadcrum.bind(this,'/homepage/regrossmargin','销售毛利统计报表')}>
                                            销售毛利统计报表
                                        </NavLink>
                                    </Menu.Item>
                                    <Menu.Item key="622">
                                        <NavLink to='/homepage/refreshloss' onClick={this.changebreadcrum.bind(this,'/homepage/refreshloss','损耗统计报表')}>
                                            损耗统计报表
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                                <SubMenu key="sub6_3" title="资金收款">
                                    <Menu.Item key="631">
                                        <NavLink to='/homepage/rereceivable' onClick={this.changebreadcrum.bind(this,'/homepage/rereceivable','应收统计报表')}>
                                            应收统计报表
                                        </NavLink>
                                    </Menu.Item>
                                </SubMenu>
                                {/*<SubMenu key="sub6_4" title="业绩核算">*/}
                                {/*    <Menu.Item key="641">*/}
                                {/*        <NavLink to='/homepage/reperformance' onClick={this.changebreadcrum.bind(this,'/homepage/reperformance','员工业绩统计报表')}>*/}
                                {/*            员工业绩统计报表*/}
                                {/*        </NavLink>*/}
                                {/*    </Menu.Item>*/}
                                {/*    <Menu.Item key="642">*/}
                                {/*        <NavLink to='/homepage/repullnew' onClick={this.changebreadcrum.bind(this,'/homepage/repullnew','客户拉新统计')}>*/}
                                {/*            客户拉新统计*/}
                                {/*        </NavLink>*/}
                                {/*    </Menu.Item>*/}
                                {/*    <Menu.Item key="643">*/}
                                {/*        <NavLink to='/homepage/restaffpullnew' onClick={this.changebreadcrum.bind(this,'/homepage/restaffpullnew','员工拉新统计')}>*/}
                                {/*            员工拉新统计*/}
                                {/*        </NavLink>*/}
                                {/*    </Menu.Item>*/}
                                {/*</SubMenu>*/}
                            </SubMenu>
                        </Menu>
                    </Sider>
                    <Layout>
                        <NewBreadcrumb/>
                        <Content
                            className="site-layout-background"
                            style={{
                                margin: '24px 16px',
                                padding: 24,
                            }}
                        >
                            {this.props.children}
                        </Content>
                    </Layout>

                </Layout>
                {/*意见反馈抽屉*/}
                <Drawer
                    placement={this.state.placement1}
                    closable={false}
                    onClose={this.onClose1}
                    visible={this.state.visible1}
                    height={400}
                    className='drawer1'
                >
                    <OpinionRate/>
                </Drawer>


                {/*公告抽屉*/}
                <Drawer
                    placement={this.state.placement2}
                    closable={false}
                    onClose={this.onClose2}
                    visible={this.state.visible2}
                    style={{padding:'0'}}
                    className='drawer2'
                >
                   <NoticeMessage></NoticeMessage>
                </Drawer>

                {/*客服组件*/}
                {showWindow}
            </Layout>
        );
    }
}

export default App;